package kr.hkit.powerjava.chapter06.assign_for;

import java.util.Scanner;

public class Three {

	private int num, inputnum;

	public Three(int num) {
		super();
		this.num = num;
	}

	void game() {
		Scanner input = new Scanner(System.in);

		do {
			System.out.print("수를 입력해보시게(음수 입력시 종료): ");
			inputnum = input.nextInt();

			if (num > inputnum) {
				System.out.println("입력된 수가 답보다 낮다");
			}

			else if (num < inputnum) {
				System.out.println("입력된 수가 답보다 높다");
			}

			else {
				System.out.println("정답");
			}
		} while (inputnum > 0 && inputnum != num);
	}
}
